package com.example.service;

import com.example.entity.StockInfo;
import com.example.mapper.StockInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StockInfoService {

    @Autowired
    private StockInfoMapper stockInfoMapper;

    /**
     *
     * @param stockCode
     * @return
     */
    public StockInfo getStockInfo(String stockCode){
        return stockInfoMapper.getStockInfo(stockCode);
    }

    /**
     *
     * @param stockInfo
     * @return
     */
    public int save(StockInfo stockInfo){
        return stockInfoMapper.save(stockInfo);
    }

    /**
     *
     * @param stockInfo
     * @return
     */
    public  int update(StockInfo stockInfo){
        return stockInfoMapper.update(stockInfo);
    }

    /**
     *
     * @param stockCode
     * @return
     */
    public int deleteByCode(String stockCode){
        return stockInfoMapper.deleteByCode(stockCode);
    }

    /**
     *
     * @return
     */
    public List<StockInfo> selectAll(){
        return stockInfoMapper.selectAll();
    }
}
